package com.yxw.springmvc.test;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by hp on 2016/7/29.
 */
@RestController
public class ApplicationDemo3 {
    @RequestMapping("/user/{username}")
    public String username(@PathVariable("username")  String username){
        return String.format("user %s", username);
    }

    @RequestMapping("/port/{id}")
    public String username(@PathVariable("id")  int  id){
        return String.format("user %s", id);
    }

}
